<!doctype html>


<html>
<head>
  <link rel="shortcut icon" href="static/images/favicon.ico" type="image/x-icon">
  <title>color.js (Closure Library API Documentation - JavaScript)</title>
  <link rel="stylesheet" href="static/css/base.css">
  <link rel="stylesheet" href="static/css/doc.css">
  <link rel="stylesheet" href="static/css/sidetree.css">
  <link rel="stylesheet" href="static/css/prettify.css">

  <script>
     var _staticFilePath = "static/";
     var _typeTreeName = "goog";
     var _fileTreeName = "Source";
  </script>

  <script src="static/js/doc.js">
  </script>


  <meta charset="utf8">
</head>

<body onload="grokdoc.onLoad();">

<div id="header">
  <div class="g-section g-tpl-50-50 g-split">
    <div class="g-unit g-first">
      <a id="logo" href="index.html">Closure Library API Documentation</a>
    </div>

    <div class="g-unit">
      <div class="g-c">
        <strong>Go to class or file:</strong>
        <input type="text" id="ac">
      </div>
    </div>
  </div>
</div>





<div class="colmask rightmenu">
<div class="colleft">
    <div class="col1">
      <!-- Column 1 start -->

<div id="title">
       <span class="fn">color.js</span>
</div>

<div class="g-section g-tpl-75-25">
  <div class="g-unit g-first" id="description">
    <span class='nodesc'>No description.</span>
  </div>
  

        <div class="g-unit" id="useful-links">
          <div class="title">Useful links</div>
          <ol>
            <li><a href="local_closure_goog_color_color.js.source.html"><span class='source-code-link'>Source Code</span></a></li>
            <li><a href="http://code.google.com/p/closure-library/source/browse/local/closure/goog/color/color.js">Git</a></li>
          </ol>
        </div>
</div>

<h2 class="g-first">File Location</h2>
  <div class="g-section g-tpl-20-80">
    <div class="g-unit g-first">
      <div class="g-c-cell code-label">/goog/color/color.js</div>
    </div>
  </div>
<hr/>


   
<br/>

  <div class="legend">
        <span class="key publickey"></span><span>Public</span>
        <span class="key protectedkey"></span><span>Protected</span>
        <span class="key privatekey"></span><span>Private</span>
  </div>









<div class="section">
  <table class="horiz-rule">


  </table>
</div>




  <h2>Global Functions</h2>





<div class="section">
  <table class="horiz-rule">


     <tr class="even entry public">
       <td class="access"></td>






  <td>
    <a name="goog.color.blend"></a>


     <div class="arg">
       <img align="left" src="static/images/blank.gif">

        <span class="entryNamespace">goog.color.</span><span class="entryName">blend<span class="args">(<span class="arg">rgb1</span>,&nbsp;<span class="arg">rgb2</span>,&nbsp;<span class="arg">factor</span>)</span>
        </span>
        &#8658; <span>!</span><span class="type">goog.color.Rgb</span>
      </div>


     <div class="entryOverview">
       Blend two colors together, using the specified factor to indicate the weight
given to the first color

     </div>


    <! -- Method details -->
    <div class="entryDetails">

      <div class="detailsSection">
        <b>Arguments: </b>






<table class="horiz-rule">
     
   <tr class="even">
     <td>
        <span class="entryName">rgb1</span>
        : <span class="type">goog.color.Rgb</span>
        <div class="entryOverview">First color represented in rgb.</div>
     </td>
   </tr>
     
   <tr class="odd">
     <td>
        <span class="entryName">rgb2</span>
        : <span class="type">goog.color.Rgb</span>
        <div class="entryOverview">Second color represented in rgb.</div>
     </td>
   </tr>
     
   <tr class="even">
     <td>
        <span class="entryName">factor</span>
        : <span class="type"><a href="https://developer.mozilla.org/en/Core_JavaScript_1.5_Reference/Global_Objects/Number">number</a></span>
        <div class="entryOverview">The weight to be given to rgb1 over rgb2. Values
    should be in the range [0, 1]. If less than 0, factor will be set to 0.
    If greater than 1, factor will be set to 1.</div>
     </td>
   </tr>
  </table>
      </div>
   
      <div class="detailsSection">
        <b>Returns:</b>&nbsp;<span>!</span><span class="type">goog.color.Rgb</span>&nbsp;
            Combined color represented in rgb.
      </div>
  
    </div>
   
  </td>


  <td class="view-code">
     <a href="local_closure_goog_color_color.js.source.html#line674">code &raquo;</a>
  </td>
     </tr>


     <tr class="odd entry private">
       <td class="access"></td>






  <td>
    <a name="goog.color.colorDiff_"></a>


     <div class="arg">
       <img align="left" src="static/images/blank.gif">

        <span class="entryNamespace">goog.color.</span><span class="entryName">colorDiff_<span class="args">(<span class="arg">rgb1</span>,&nbsp;<span class="arg">rgb2</span>)</span>
        </span>
        &#8658; <span class="type"><a href="https://developer.mozilla.org/en/Core_JavaScript_1.5_Reference/Global_Objects/Number">number</a></span>
      </div>


     <div class="entryOverview">
       Calculate color difference between two colors. Helper method for
goog.color.highContrast()

     </div>


    <! -- Method details -->
    <div class="entryDetails">

      <div class="detailsSection">
        <b>Arguments: </b>






<table class="horiz-rule">
     
   <tr class="even">
     <td>
        <span class="entryName">rgb1</span>
        : <span class="type">goog.color.Rgb</span>
        <div class="entryOverview">Color represented by a rgb array.</div>
     </td>
   </tr>
     
   <tr class="odd">
     <td>
        <span class="entryName">rgb2</span>
        : <span class="type">goog.color.Rgb</span>
        <div class="entryOverview">Color represented by a rgb array.</div>
     </td>
   </tr>
  </table>
      </div>
   
      <div class="detailsSection">
        <b>Returns:</b>&nbsp;<span class="type"><a href="https://developer.mozilla.org/en/Core_JavaScript_1.5_Reference/Global_Objects/Number">number</a></span>&nbsp;
            Color difference.
      </div>
  
    </div>
   
  </td>


  <td class="view-code">
     <a href="local_closure_goog_color_color.js.source.html#line773">code &raquo;</a>
  </td>
     </tr>


     <tr class="even entry public">
       <td class="access"></td>






  <td>
    <a name="goog.color.darken"></a>


     <div class="arg">
       <img align="left" src="static/images/blank.gif">

        <span class="entryNamespace">goog.color.</span><span class="entryName">darken<span class="args">(<span class="arg">rgb</span>,&nbsp;<span class="arg">factor</span>)</span>
        </span>
        &#8658; <span>!</span><span class="type">goog.color.Rgb</span>
      </div>


     <div class="entryOverview">
       Adds black to the specified color, darkening it

     </div>


    <! -- Method details -->
    <div class="entryDetails">

      <div class="detailsSection">
        <b>Arguments: </b>






<table class="horiz-rule">
     
   <tr class="even">
     <td>
        <span class="entryName">rgb</span>
        : <span class="type">goog.color.Rgb</span>
        <div class="entryOverview">rgb representation of the color.</div>
     </td>
   </tr>
     
   <tr class="odd">
     <td>
        <span class="entryName">factor</span>
        : <span class="type"><a href="https://developer.mozilla.org/en/Core_JavaScript_1.5_Reference/Global_Objects/Number">number</a></span>
        <div class="entryOverview">Number in the range [0, 1]. 0 will do nothing, while
    1 will return black. If less than 0, factor will be set to 0. If greater
    than 1, factor will be set to 1.</div>
     </td>
   </tr>
  </table>
      </div>
   
      <div class="detailsSection">
        <b>Returns:</b>&nbsp;<span>!</span><span class="type">goog.color.Rgb</span>&nbsp;
            Combined rgb color.
      </div>
  
    </div>
   
  </td>


  <td class="view-code">
     <a href="local_closure_goog_color_color.js.source.html#line693">code &raquo;</a>
  </td>
     </tr>


     <tr class="odd entry public">
       <td class="access"></td>






  <td>
    <a name="goog.color.hexToHsl"></a>


     <div class="arg">
       <img align="left" src="static/images/blank.gif">

        <span class="entryNamespace">goog.color.</span><span class="entryName">hexToHsl<span class="args">(<span class="arg">hex</span>)</span>
        </span>
        &#8658; <span>!</span><span class="type">goog.color.Hsv</span>
      </div>


     <div class="entryOverview">
       Converts a hex representation of a color to HSL.

     </div>


    <! -- Method details -->
    <div class="entryDetails">

      <div class="detailsSection">
        <b>Arguments: </b>






<table class="horiz-rule">
     
   <tr class="even">
     <td>
        <span class="entryName">hex</span>
        : <span class="type"><a href="https://developer.mozilla.org/en/Core_JavaScript_1.5_Reference/Global_Objects/String">string</a></span>
        <div class="entryOverview">Color to convert.</div>
     </td>
   </tr>
  </table>
      </div>
   
      <div class="detailsSection">
        <b>Returns:</b>&nbsp;<span>!</span><span class="type">goog.color.Hsv</span>&nbsp;
            hsv representation of the color.
      </div>
  
    </div>
   
  </td>


  <td class="view-code">
     <a href="local_closure_goog_color_color.js.source.html#line571">code &raquo;</a>
  </td>
     </tr>


     <tr class="even entry public">
       <td class="access"></td>






  <td>
    <a name="goog.color.hexToHsv"></a>


     <div class="arg">
       <img align="left" src="static/images/blank.gif">

        <span class="entryNamespace">goog.color.</span><span class="entryName">hexToHsv<span class="args">(<span class="arg">hex</span>)</span>
        </span>
        &#8658; <span>!</span><span class="type">goog.color.Hsv</span>
      </div>


     <div class="entryOverview">
       Converts a hex representation of a color to HSV

     </div>


    <! -- Method details -->
    <div class="entryDetails">

      <div class="detailsSection">
        <b>Arguments: </b>






<table class="horiz-rule">
     
   <tr class="even">
     <td>
        <span class="entryName">hex</span>
        : <span class="type"><a href="https://developer.mozilla.org/en/Core_JavaScript_1.5_Reference/Global_Objects/String">string</a></span>
        <div class="entryOverview">Color to convert.</div>
     </td>
   </tr>
  </table>
      </div>
   
      <div class="detailsSection">
        <b>Returns:</b>&nbsp;<span>!</span><span class="type">goog.color.Hsv</span>&nbsp;
            hsv representation of the color.
      </div>
  
    </div>
   
  </td>


  <td class="view-code">
     <a href="local_closure_goog_color_color.js.source.html#line604">code &raquo;</a>
  </td>
     </tr>


     <tr class="odd entry public">
       <td class="access"></td>






  <td>
    <a name="goog.color.hexToRgb"></a>


     <div class="arg">
       <img align="left" src="static/images/blank.gif">

        <span class="entryNamespace">goog.color.</span><span class="entryName">hexToRgb<span class="args">(<span class="arg">hexColor</span>)</span>
        </span>
        &#8658; <span>!</span><span class="type">goog.color.Rgb</span>
      </div>


     <div class="entryOverview">
       Converts a hex representation of a color to RGB.

     </div>


    <! -- Method details -->
    <div class="entryDetails">

      <div class="detailsSection">
        <b>Arguments: </b>






<table class="horiz-rule">
     
   <tr class="even">
     <td>
        <span class="entryName">hexColor</span>
        : <span class="type"><a href="https://developer.mozilla.org/en/Core_JavaScript_1.5_Reference/Global_Objects/String">string</a></span>
        <div class="entryOverview">Color to convert.</div>
     </td>
   </tr>
  </table>
      </div>
   
      <div class="detailsSection">
        <b>Returns:</b>&nbsp;<span>!</span><span class="type">goog.color.Rgb</span>&nbsp;
            rgb representation of the color.
      </div>
  
    </div>
   
  </td>


  <td class="view-code">
     <a href="local_closure_goog_color_color.js.source.html#line163">code &raquo;</a>
  </td>
     </tr>


     <tr class="even entry public">
       <td class="access"></td>






  <td>
    <a name="goog.color.hexToRgbStyle"></a>


     <div class="arg">
       <img align="left" src="static/images/blank.gif">

        <span class="entryNamespace">goog.color.</span><span class="entryName">hexToRgbStyle<span class="args">(<span class="arg">hexColor</span>)</span>
        </span>
        &#8658; <span class="type"><a href="https://developer.mozilla.org/en/Core_JavaScript_1.5_Reference/Global_Objects/String">string</a></span>
      </div>


     <div class="entryOverview">
       Converts a hex representation of a color to RGB.

     </div>


    <! -- Method details -->
    <div class="entryDetails">

      <div class="detailsSection">
        <b>Arguments: </b>






<table class="horiz-rule">
     
   <tr class="even">
     <td>
        <span class="entryName">hexColor</span>
        : <span class="type"><a href="https://developer.mozilla.org/en/Core_JavaScript_1.5_Reference/Global_Objects/String">string</a></span>
        <div class="entryOverview">Color to convert.</div>
     </td>
   </tr>
  </table>
      </div>
   
      <div class="detailsSection">
        <b>Returns:</b>&nbsp;<span class="type"><a href="https://developer.mozilla.org/en/Core_JavaScript_1.5_Reference/Global_Objects/String">string</a></span>&nbsp;
            string of the form 'rgb(R,G,B)' which can be used in
   styles.
      </div>
  
    </div>
   
  </td>


  <td class="view-code">
     <a href="local_closure_goog_color_color.js.source.html#line128">code &raquo;</a>
  </td>
     </tr>


     <tr class="odd entry public">
       <td class="access"></td>






  <td>
    <a name="goog.color.highContrast"></a>


     <div class="arg">
       <img align="left" src="static/images/blank.gif">

        <span class="entryNamespace">goog.color.</span><span class="entryName">highContrast<span class="args">(<span class="arg">prime</span>,&nbsp;<span class="arg">suggestions</span>)</span>
        </span>
        &#8658; <span>!</span><span class="type">goog.color.Rgb</span>
      </div>


     <div class="entryOverview">
       Find the "best" (highest-contrast) of the suggested colors for the prime
color. Uses W3C formula for judging readability and visual accessibility:
<a href="http://www.w3.org/TR/AERT#color-contrast">http://www.w3.org/TR/AERT#color-contrast</a>

     </div>


    <! -- Method details -->
    <div class="entryDetails">

      <div class="detailsSection">
        <b>Arguments: </b>






<table class="horiz-rule">
     
   <tr class="even">
     <td>
        <span class="entryName">prime</span>
        : <span class="type">goog.color.Rgb</span>
        <div class="entryOverview">Color represented as a rgb array.</div>
     </td>
   </tr>
     
   <tr class="odd">
     <td>
        <span class="entryName">suggestions</span>
        : <span class="type"><a href="https://developer.mozilla.org/en/Core_JavaScript_1.5_Reference/Global_Objects/Array">Array</a></span>.&lt;<span class="type">goog.color.Rgb</span>&gt;
        <div class="entryOverview">Array of colors,
    each representing a rgb array.</div>
     </td>
   </tr>
  </table>
      </div>
   
      <div class="detailsSection">
        <b>Returns:</b>&nbsp;<span>!</span><span class="type">goog.color.Rgb</span>&nbsp;
            Highest-contrast color represented by an array..
      </div>
  
    </div>
   
  </td>


  <td class="view-code">
     <a href="local_closure_goog_color_color.js.source.html#line722">code &raquo;</a>
  </td>
     </tr>


     <tr class="even entry public">
       <td class="access"></td>






  <td>
    <a name="goog.color.hslArrayToHex"></a>


     <div class="arg">
       <img align="left" src="static/images/blank.gif">

        <span class="entryNamespace">goog.color.</span><span class="entryName">hslArrayToHex<span class="args">(<span class="arg">hsl</span>)</span>
        </span>
        &#8658; <span class="type"><a href="https://developer.mozilla.org/en/Core_JavaScript_1.5_Reference/Global_Objects/String">string</a></span>
      </div>


     <div class="entryOverview">
       Converts from an hsl array to a hex string

     </div>


    <! -- Method details -->
    <div class="entryDetails">

      <div class="detailsSection">
        <b>Arguments: </b>






<table class="horiz-rule">
     
   <tr class="even">
     <td>
        <span class="entryName">hsl</span>
        : <span class="type">goog.color.Hsl</span>
        <div class="entryOverview">hsl representation of the color.</div>
     </td>
   </tr>
  </table>
      </div>
   
      <div class="detailsSection">
        <b>Returns:</b>&nbsp;<span class="type"><a href="https://developer.mozilla.org/en/Core_JavaScript_1.5_Reference/Global_Objects/String">string</a></span>&nbsp;
            hex representation of the color.
      </div>
  
    </div>
   
  </td>


  <td class="view-code">
     <a href="local_closure_goog_color_color.js.source.html#line594">code &raquo;</a>
  </td>
     </tr>


     <tr class="odd entry public">
       <td class="access"></td>






  <td>
    <a name="goog.color.hslArrayToRgb"></a>


     <div class="arg">
       <img align="left" src="static/images/blank.gif">

        <span class="entryNamespace">goog.color.</span><span class="entryName">hslArrayToRgb<span class="args">(<span class="arg">hsl</span>)</span>
        </span>
        &#8658; <span>!</span><span class="type">goog.color.Rgb</span>
      </div>


     <div class="entryOverview">
       Converts a color from HSL color space to RGB color space.

     </div>


    <! -- Method details -->
    <div class="entryDetails">

      <div class="detailsSection">
        <b>Arguments: </b>






<table class="horiz-rule">
     
   <tr class="even">
     <td>
        <span class="entryName">hsl</span>
        : <span class="type">goog.color.Hsl</span>
        <div class="entryOverview">hsl representation of the color.</div>
     </td>
   </tr>
  </table>
      </div>
   
      <div class="detailsSection">
        <b>Returns:</b>&nbsp;<span>!</span><span class="type">goog.color.Rgb</span>&nbsp;
            rgb representation of the color.
      </div>
  
    </div>
   
  </td>


  <td class="view-code">
     <a href="local_closure_goog_color_color.js.source.html#line324">code &raquo;</a>
  </td>
     </tr>


     <tr class="even entry public">
       <td class="access"></td>






  <td>
    <a name="goog.color.hslDistance"></a>


     <div class="arg">
       <img align="left" src="static/images/blank.gif">

        <span class="entryNamespace">goog.color.</span><span class="entryName">hslDistance<span class="args">(<span class="arg">hsl1</span>,&nbsp;<span class="arg">hsl2</span>)</span>
        </span>
        &#8658; <span class="type"><a href="https://developer.mozilla.org/en/Core_JavaScript_1.5_Reference/Global_Objects/Number">number</a></span>
      </div>


     <div class="entryOverview">
       Calculates the Euclidean distance between two color vectors on an HSL sphere.
A demo of the sphere can be found at:
<a href="http://en.wikipedia.org/wiki/HSL_color_space">http://en.wikipedia.org/wiki/HSL_color_space</a>
In short, a vector for color (H, S, L) in this system can be expressed as
(S*L'*cos(2*PI*H), S*L'*sin(2*PI*H), L), where L' = abs(L - 0.5), and we
simply calculate the 1-2 distance using these coordinates

     </div>


    <! -- Method details -->
    <div class="entryDetails">

      <div class="detailsSection">
        <b>Arguments: </b>






<table class="horiz-rule">
     
   <tr class="even">
     <td>
        <span class="entryName">hsl1</span>
        : <span class="type">goog.color.Hsl</span>
        <div class="entryOverview">First color in hsl representation.</div>
     </td>
   </tr>
     
   <tr class="odd">
     <td>
        <span class="entryName">hsl2</span>
        : <span class="type">goog.color.Hsl</span>
        <div class="entryOverview">Second color in hsl representation.</div>
     </td>
   </tr>
  </table>
      </div>
   
      <div class="detailsSection">
        <b>Returns:</b>&nbsp;<span class="type"><a href="https://developer.mozilla.org/en/Core_JavaScript_1.5_Reference/Global_Objects/Number">number</a></span>&nbsp;
            Distance between the two colors, in the range [0, 1].
      </div>
  
    </div>
   
  </td>


  <td class="view-code">
     <a href="local_closure_goog_color_color.js.source.html#line642">code &raquo;</a>
  </td>
     </tr>


     <tr class="odd entry public">
       <td class="access"></td>






  <td>
    <a name="goog.color.hslToHex"></a>


     <div class="arg">
       <img align="left" src="static/images/blank.gif">

        <span class="entryNamespace">goog.color.</span><span class="entryName">hslToHex<span class="args">(<span class="arg">h</span>,&nbsp;<span class="arg">s</span>,&nbsp;<span class="arg">l</span>)</span>
        </span>
        &#8658; <span class="type"><a href="https://developer.mozilla.org/en/Core_JavaScript_1.5_Reference/Global_Objects/String">string</a></span>
      </div>


     <div class="entryOverview">
       Converts from h,s,l values to a hex string

     </div>


    <! -- Method details -->
    <div class="entryDetails">

      <div class="detailsSection">
        <b>Arguments: </b>






<table class="horiz-rule">
     
   <tr class="even">
     <td>
        <span class="entryName">h</span>
        : <span class="type"><a href="https://developer.mozilla.org/en/Core_JavaScript_1.5_Reference/Global_Objects/Number">number</a></span>
        <div class="entryOverview">Hue, in [0, 360].</div>
     </td>
   </tr>
     
   <tr class="odd">
     <td>
        <span class="entryName">s</span>
        : <span class="type"><a href="https://developer.mozilla.org/en/Core_JavaScript_1.5_Reference/Global_Objects/Number">number</a></span>
        <div class="entryOverview">Saturation, in [0, 1].</div>
     </td>
   </tr>
     
   <tr class="even">
     <td>
        <span class="entryName">l</span>
        : <span class="type"><a href="https://developer.mozilla.org/en/Core_JavaScript_1.5_Reference/Global_Objects/Number">number</a></span>
        <div class="entryOverview">Luminosity, in [0, 1].</div>
     </td>
   </tr>
  </table>
      </div>
   
      <div class="detailsSection">
        <b>Returns:</b>&nbsp;<span class="type"><a href="https://developer.mozilla.org/en/Core_JavaScript_1.5_Reference/Global_Objects/String">string</a></span>&nbsp;
            hex representation of the color.
      </div>
  
    </div>
   
  </td>


  <td class="view-code">
     <a href="local_closure_goog_color_color.js.source.html#line584">code &raquo;</a>
  </td>
     </tr>


     <tr class="even entry public">
       <td class="access"></td>






  <td>
    <a name="goog.color.hslToRgb"></a>


     <div class="arg">
       <img align="left" src="static/images/blank.gif">

        <span class="entryNamespace">goog.color.</span><span class="entryName">hslToRgb<span class="args">(<span class="arg">h</span>,&nbsp;<span class="arg">s</span>,&nbsp;<span class="arg">l</span>)</span>
        </span>
        &#8658; <span>!</span><span class="type">goog.color.Rgb</span>
      </div>


     <div class="entryOverview">
       Converts a color from HSL color space to RGB color space.
Modified from <code> <a href="http://www.easyrgb.com/math.html">http://www.easyrgb.com/math.html</a></code>
     </div>


    <! -- Method details -->
    <div class="entryDetails">

      <div class="detailsSection">
        <b>Arguments: </b>






<table class="horiz-rule">
     
   <tr class="even">
     <td>
        <span class="entryName">h</span>
        : <span class="type"><a href="https://developer.mozilla.org/en/Core_JavaScript_1.5_Reference/Global_Objects/Number">number</a></span>
        <div class="entryOverview">Hue, in [0, 360].</div>
     </td>
   </tr>
     
   <tr class="odd">
     <td>
        <span class="entryName">s</span>
        : <span class="type"><a href="https://developer.mozilla.org/en/Core_JavaScript_1.5_Reference/Global_Objects/Number">number</a></span>
        <div class="entryOverview">Saturation, in [0, 1].</div>
     </td>
   </tr>
     
   <tr class="even">
     <td>
        <span class="entryName">l</span>
        : <span class="type"><a href="https://developer.mozilla.org/en/Core_JavaScript_1.5_Reference/Global_Objects/Number">number</a></span>
        <div class="entryOverview">Luminosity, in [0, 1].</div>
     </td>
   </tr>
  </table>
      </div>
   
      <div class="detailsSection">
        <b>Returns:</b>&nbsp;<span>!</span><span class="type">goog.color.Rgb</span>&nbsp;
            rgb representation of the color.
      </div>
  
    </div>
   
  </td>


  <td class="view-code">
     <a href="local_closure_goog_color_color.js.source.html#line293">code &raquo;</a>
  </td>
     </tr>


     <tr class="odd entry public">
       <td class="access"></td>






  <td>
    <a name="goog.color.hsvArrayToHex"></a>


     <div class="arg">
       <img align="left" src="static/images/blank.gif">

        <span class="entryNamespace">goog.color.</span><span class="entryName">hsvArrayToHex<span class="args">(<span class="arg">hsv</span>)</span>
        </span>
        &#8658; <span class="type"><a href="https://developer.mozilla.org/en/Core_JavaScript_1.5_Reference/Global_Objects/String">string</a></span>
      </div>


     <div class="entryOverview">
       Converts from an HSV array to a hex string

     </div>


    <! -- Method details -->
    <div class="entryDetails">

      <div class="detailsSection">
        <b>Arguments: </b>






<table class="horiz-rule">
     
   <tr class="even">
     <td>
        <span class="entryName">hsv</span>
        : <span class="type">goog.color.Hsv</span>
        <div class="entryOverview">hsv representation of the color.</div>
     </td>
   </tr>
  </table>
      </div>
   
      <div class="detailsSection">
        <b>Returns:</b>&nbsp;<span class="type"><a href="https://developer.mozilla.org/en/Core_JavaScript_1.5_Reference/Global_Objects/String">string</a></span>&nbsp;
            hex representation of the color.
      </div>
  
    </div>
   
  </td>


  <td class="view-code">
     <a href="local_closure_goog_color_color.js.source.html#line626">code &raquo;</a>
  </td>
     </tr>


     <tr class="even entry public">
       <td class="access"></td>






  <td>
    <a name="goog.color.hsvArrayToRgb"></a>


     <div class="arg">
       <img align="left" src="static/images/blank.gif">

        <span class="entryNamespace">goog.color.</span><span class="entryName">hsvArrayToRgb<span class="args">(<span class="arg">hsv</span>)</span>
        </span>
        &#8658; <span>!</span><span class="type">goog.color.Rgb</span>
      </div>


     <div class="entryOverview">
       Converts an HSV triplet to an RGB array.

     </div>


    <! -- Method details -->
    <div class="entryDetails">

      <div class="detailsSection">
        <b>Arguments: </b>






<table class="horiz-rule">
     
   <tr class="even">
     <td>
        <span class="entryName">hsv</span>
        : <span class="type">goog.color.Hsv</span>
        <div class="entryOverview">hsv representation of the color.</div>
     </td>
   </tr>
  </table>
      </div>
   
      <div class="detailsSection">
        <b>Returns:</b>&nbsp;<span>!</span><span class="type">goog.color.Rgb</span>&nbsp;
            rgb representation of the color.
      </div>
  
    </div>
   
  </td>


  <td class="view-code">
     <a href="local_closure_goog_color_color.js.source.html#line561">code &raquo;</a>
  </td>
     </tr>


     <tr class="odd entry public">
       <td class="access"></td>






  <td>
    <a name="goog.color.hsvToHex"></a>


     <div class="arg">
       <img align="left" src="static/images/blank.gif">

        <span class="entryNamespace">goog.color.</span><span class="entryName">hsvToHex<span class="args">(<span class="arg">h</span>,&nbsp;<span class="arg">s</span>,&nbsp;<span class="arg">v</span>)</span>
        </span>
        &#8658; <span class="type"><a href="https://developer.mozilla.org/en/Core_JavaScript_1.5_Reference/Global_Objects/String">string</a></span>
      </div>


     <div class="entryOverview">
       Converts from h,s,v values to a hex string

     </div>


    <! -- Method details -->
    <div class="entryDetails">

      <div class="detailsSection">
        <b>Arguments: </b>






<table class="horiz-rule">
     
   <tr class="even">
     <td>
        <span class="entryName">h</span>
        : <span class="type"><a href="https://developer.mozilla.org/en/Core_JavaScript_1.5_Reference/Global_Objects/Number">number</a></span>
        <div class="entryOverview">Hue, in [0, 360].</div>
     </td>
   </tr>
     
   <tr class="odd">
     <td>
        <span class="entryName">s</span>
        : <span class="type"><a href="https://developer.mozilla.org/en/Core_JavaScript_1.5_Reference/Global_Objects/Number">number</a></span>
        <div class="entryOverview">Saturation, in [0, 1].</div>
     </td>
   </tr>
     
   <tr class="even">
     <td>
        <span class="entryName">v</span>
        : <span class="type"><a href="https://developer.mozilla.org/en/Core_JavaScript_1.5_Reference/Global_Objects/Number">number</a></span>
        <div class="entryOverview">Value, in [0, 255].</div>
     </td>
   </tr>
  </table>
      </div>
   
      <div class="detailsSection">
        <b>Returns:</b>&nbsp;<span class="type"><a href="https://developer.mozilla.org/en/Core_JavaScript_1.5_Reference/Global_Objects/String">string</a></span>&nbsp;
            hex representation of the color.
      </div>
  
    </div>
   
  </td>


  <td class="view-code">
     <a href="local_closure_goog_color_color.js.source.html#line616">code &raquo;</a>
  </td>
     </tr>


     <tr class="even entry public">
       <td class="access"></td>






  <td>
    <a name="goog.color.hsvToRgb"></a>


     <div class="arg">
       <img align="left" src="static/images/blank.gif">

        <span class="entryNamespace">goog.color.</span><span class="entryName">hsvToRgb<span class="args">(<span class="arg">h</span>,&nbsp;<span class="arg">s</span>,&nbsp;<span class="arg">brightness</span>)</span>
        </span>
        &#8658; <span>!</span><span class="type">goog.color.Rgb</span>
      </div>


     <div class="entryOverview">
       Converts an HSV triplet to an RGB array.  V is brightness because b is
  reserved for blue in RGB.

     </div>


    <! -- Method details -->
    <div class="entryDetails">

      <div class="detailsSection">
        <b>Arguments: </b>






<table class="horiz-rule">
     
   <tr class="even">
     <td>
        <span class="entryName">h</span>
        : <span class="type"><a href="https://developer.mozilla.org/en/Core_JavaScript_1.5_Reference/Global_Objects/Number">number</a></span>
        <div class="entryOverview">Hue value in [0, 360].</div>
     </td>
   </tr>
     
   <tr class="odd">
     <td>
        <span class="entryName">s</span>
        : <span class="type"><a href="https://developer.mozilla.org/en/Core_JavaScript_1.5_Reference/Global_Objects/Number">number</a></span>
        <div class="entryOverview">Saturation value in [0, 1].</div>
     </td>
   </tr>
     
   <tr class="even">
     <td>
        <span class="entryName">brightness</span>
        : <span class="type"><a href="https://developer.mozilla.org/en/Core_JavaScript_1.5_Reference/Global_Objects/Number">number</a></span>
        <div class="entryOverview">brightness in [0, 255].</div>
     </td>
   </tr>
  </table>
      </div>
   
      <div class="detailsSection">
        <b>Returns:</b>&nbsp;<span>!</span><span class="type">goog.color.Rgb</span>&nbsp;
            rgb representation of the color.
      </div>
  
    </div>
   
  </td>


  <td class="view-code">
     <a href="local_closure_goog_color_color.js.source.html#line452">code &raquo;</a>
  </td>
     </tr>


     <tr class="odd entry private">
       <td class="access"></td>






  <td>
    <a name="goog.color.hueToRgb_"></a>


     <div class="arg">
       <img align="left" src="static/images/blank.gif">

        <span class="entryNamespace">goog.color.</span><span class="entryName">hueToRgb_<span class="args">(<span class="arg">v1</span>,&nbsp;<span class="arg">v2</span>,&nbsp;<span class="arg">vH</span>)</span>
        </span>
        &#8658; <span class="type"><a href="https://developer.mozilla.org/en/Core_JavaScript_1.5_Reference/Global_Objects/Number">number</a></span>
      </div>


     <div class="entryOverview">
       Helper for hslToRgb.

     </div>


    <! -- Method details -->
    <div class="entryDetails">

      <div class="detailsSection">
        <b>Arguments: </b>






<table class="horiz-rule">
     
   <tr class="even">
     <td>
        <span class="entryName">v1</span>
        : <span class="type"><a href="https://developer.mozilla.org/en/Core_JavaScript_1.5_Reference/Global_Objects/Number">number</a></span>
        <div class="entryOverview">Helper variable 1.</div>
     </td>
   </tr>
     
   <tr class="odd">
     <td>
        <span class="entryName">v2</span>
        : <span class="type"><a href="https://developer.mozilla.org/en/Core_JavaScript_1.5_Reference/Global_Objects/Number">number</a></span>
        <div class="entryOverview">Helper variable 2.</div>
     </td>
   </tr>
     
   <tr class="even">
     <td>
        <span class="entryName">vH</span>
        : <span class="type"><a href="https://developer.mozilla.org/en/Core_JavaScript_1.5_Reference/Global_Objects/Number">number</a></span>
        <div class="entryOverview">Helper variable 3.</div>
     </td>
   </tr>
  </table>
      </div>
   
      <div class="detailsSection">
        <b>Returns:</b>&nbsp;<span class="type"><a href="https://developer.mozilla.org/en/Core_JavaScript_1.5_Reference/Global_Objects/Number">number</a></span>&nbsp;
            Appropriate RGB value, given the above.
      </div>
  
    </div>
   
  </td>


  <td class="view-code">
     <a href="local_closure_goog_color_color.js.source.html#line268">code &raquo;</a>
  </td>
     </tr>


     <tr class="even entry private">
       <td class="access"></td>






  <td>
    <a name="goog.color.isNormalizedHexColor_"></a>


     <div class="arg">
       <img align="left" src="static/images/blank.gif">

        <span class="entryNamespace">goog.color.</span><span class="entryName">isNormalizedHexColor_<span class="args">(<span class="arg">str</span>)</span>
        </span>
        &#8658; <span class="type"><a href="https://developer.mozilla.org/en/Core_JavaScript_1.5_Reference/Global_Objects/Boolean">boolean</a></span>
      </div>


     <div class="entryOverview">
       Checks if a string is a normalized hex color.
We expect strings of the format #RRGGBB (ex: #1b3d5f)
using only lowercase letters.

     </div>


    <! -- Method details -->
    <div class="entryDetails">

      <div class="detailsSection">
        <b>Arguments: </b>






<table class="horiz-rule">
     
   <tr class="even">
     <td>
        <span class="entryName">str</span>
        : <span class="type"><a href="https://developer.mozilla.org/en/Core_JavaScript_1.5_Reference/Global_Objects/String">string</a></span>
        <div class="entryOverview">String to check.</div>
     </td>
   </tr>
  </table>
      </div>
   
      <div class="detailsSection">
        <b>Returns:</b>&nbsp;<span class="type"><a href="https://developer.mozilla.org/en/Core_JavaScript_1.5_Reference/Global_Objects/Boolean">boolean</a></span>&nbsp;
            Whether the string is a normalized hex color.
      </div>
  
    </div>
   
  </td>


  <td class="view-code">
     <a href="local_closure_goog_color_color.js.source.html#line365">code &raquo;</a>
  </td>
     </tr>


     <tr class="odd entry public">
       <td class="access"></td>






  <td>
    <a name="goog.color.isValidColor"></a>


     <div class="arg">
       <img align="left" src="static/images/blank.gif">

        <span class="entryNamespace">goog.color.</span><span class="entryName">isValidColor<span class="args">(<span class="arg">str</span>)</span>
        </span>
        &#8658; <span class="type"><a href="https://developer.mozilla.org/en/Core_JavaScript_1.5_Reference/Global_Objects/Boolean">boolean</a></span>
      </div>


     <div class="entryOverview">
       Determines if the given string can be parsed as a color.
    .

     </div>


    <! -- Method details -->
    <div class="entryDetails">

      <div class="detailsSection">
        <b>Arguments: </b>






<table class="horiz-rule">
     
   <tr class="even">
     <td>
        <span class="entryName">str</span>
        : <span class="type"><a href="https://developer.mozilla.org/en/Core_JavaScript_1.5_Reference/Global_Objects/String">string</a></span>
        <div class="entryOverview">Potential color string.</div>
     </td>
   </tr>
  </table>
      </div>
   
      <div class="detailsSection">
        <b>Returns:</b>&nbsp;<span class="type"><a href="https://developer.mozilla.org/en/Core_JavaScript_1.5_Reference/Global_Objects/Boolean">boolean</a></span>&nbsp;
            True if str is in a format that can be parsed to a color.
      </div>
  
    </div>
   
  </td>


  <td class="view-code">
     <a href="local_closure_goog_color_color.js.source.html#line98">code &raquo;</a>
  </td>
     </tr>


     <tr class="even entry private">
       <td class="access"></td>






  <td>
    <a name="goog.color.isValidHexColor_"></a>


     <div class="arg">
       <img align="left" src="static/images/blank.gif">

        <span class="entryNamespace">goog.color.</span><span class="entryName">isValidHexColor_<span class="args">(<span class="arg">str</span>)</span>
        </span>
        &#8658; <span class="type"><a href="https://developer.mozilla.org/en/Core_JavaScript_1.5_Reference/Global_Objects/Boolean">boolean</a></span>
      </div>


     <div class="entryOverview">
       Checks if a string is a valid hex color.  We expect strings of the format
#RRGGBB (ex: #1b3d5f) or #RGB (ex: #3CA == #33CCAA).

     </div>


    <! -- Method details -->
    <div class="entryDetails">

      <div class="detailsSection">
        <b>Arguments: </b>






<table class="horiz-rule">
     
   <tr class="even">
     <td>
        <span class="entryName">str</span>
        : <span class="type"><a href="https://developer.mozilla.org/en/Core_JavaScript_1.5_Reference/Global_Objects/String">string</a></span>
        <div class="entryOverview">String to check.</div>
     </td>
   </tr>
  </table>
      </div>
   
      <div class="detailsSection">
        <b>Returns:</b>&nbsp;<span class="type"><a href="https://developer.mozilla.org/en/Core_JavaScript_1.5_Reference/Global_Objects/Boolean">boolean</a></span>&nbsp;
            Whether the string is a valid hex color.
      </div>
  
    </div>
   
  </td>


  <td class="view-code">
     <a href="local_closure_goog_color_color.js.source.html#line344">code &raquo;</a>
  </td>
     </tr>


     <tr class="odd entry private">
       <td class="access"></td>






  <td>
    <a name="goog.color.isValidRgbColor_"></a>


     <div class="arg">
       <img align="left" src="static/images/blank.gif">

        <span class="entryNamespace">goog.color.</span><span class="entryName">isValidRgbColor_<span class="args">(<span class="arg">str</span>)</span>
        </span>
        &#8658; <span>!</span><span class="type">goog.color.Rgb</span>
      </div>


     <div class="entryOverview">
       Checks if a string is a valid rgb color.  We expect strings of the format
'(r, g, b)', or 'rgb(r, g, b)', where each color component is an int in
[0, 255].

     </div>


    <! -- Method details -->
    <div class="entryDetails">

      <div class="detailsSection">
        <b>Arguments: </b>






<table class="horiz-rule">
     
   <tr class="even">
     <td>
        <span class="entryName">str</span>
        : <span class="type"><a href="https://developer.mozilla.org/en/Core_JavaScript_1.5_Reference/Global_Objects/String">string</a></span>
        <div class="entryOverview">String to check.</div>
     </td>
   </tr>
  </table>
      </div>
   
      <div class="detailsSection">
        <b>Returns:</b>&nbsp;<span>!</span><span class="type">goog.color.Rgb</span>&nbsp;
            the rgb representation of the color if it is
    a valid color, or the empty array otherwise.
      </div>
  
    </div>
   
  </td>


  <td class="view-code">
     <a href="local_closure_goog_color_color.js.source.html#line389">code &raquo;</a>
  </td>
     </tr>


     <tr class="even entry public">
       <td class="access"></td>






  <td>
    <a name="goog.color.lighten"></a>


     <div class="arg">
       <img align="left" src="static/images/blank.gif">

        <span class="entryNamespace">goog.color.</span><span class="entryName">lighten<span class="args">(<span class="arg">rgb</span>,&nbsp;<span class="arg">factor</span>)</span>
        </span>
        &#8658; <span>!</span><span class="type">goog.color.Rgb</span>
      </div>


     <div class="entryOverview">
       Adds white to the specified color, lightening it

     </div>


    <! -- Method details -->
    <div class="entryDetails">

      <div class="detailsSection">
        <b>Arguments: </b>






<table class="horiz-rule">
     
   <tr class="even">
     <td>
        <span class="entryName">rgb</span>
        : <span class="type">goog.color.Rgb</span>
        <div class="entryOverview">rgb representation of the color.</div>
     </td>
   </tr>
     
   <tr class="odd">
     <td>
        <span class="entryName">factor</span>
        : <span class="type"><a href="https://developer.mozilla.org/en/Core_JavaScript_1.5_Reference/Global_Objects/Number">number</a></span>
        <div class="entryOverview">Number in the range [0, 1].  0 will do nothing, while
    1 will return white. If less than 0, factor will be set to 0. If greater
    than 1, factor will be set to 1.</div>
     </td>
   </tr>
  </table>
      </div>
   
      <div class="detailsSection">
        <b>Returns:</b>&nbsp;<span>!</span><span class="type">goog.color.Rgb</span>&nbsp;
            Combined rgb color.
      </div>
  
    </div>
   
  </td>


  <td class="view-code">
     <a href="local_closure_goog_color_color.js.source.html#line707">code &raquo;</a>
  </td>
     </tr>


     <tr class="odd entry public">
       <td class="access"></td>






  <td>
    <a name="goog.color.normalizeHex"></a>


     <div class="arg">
       <img align="left" src="static/images/blank.gif">

        <span class="entryNamespace">goog.color.</span><span class="entryName">normalizeHex<span class="args">(<span class="arg">hexColor</span>)</span>
        </span>
        &#8658; <span class="type"><a href="https://developer.mozilla.org/en/Core_JavaScript_1.5_Reference/Global_Objects/String">string</a></span>
      </div>


     <div class="entryOverview">
       Normalize an hex representation of a color

     </div>


    <! -- Method details -->
    <div class="entryDetails">

      <div class="detailsSection">
        <b>Arguments: </b>






<table class="horiz-rule">
     
   <tr class="even">
     <td>
        <span class="entryName">hexColor</span>
        : <span class="type"><a href="https://developer.mozilla.org/en/Core_JavaScript_1.5_Reference/Global_Objects/String">string</a></span>
        <div class="entryOverview">an hex color string.</div>
     </td>
   </tr>
  </table>
      </div>
   
      <div class="detailsSection">
        <b>Returns:</b>&nbsp;<span class="type"><a href="https://developer.mozilla.org/en/Core_JavaScript_1.5_Reference/Global_Objects/String">string</a></span>&nbsp;
            hex color in the format '#rrggbb' with all lowercase
    literals.
      </div>
  
    </div>
   
  </td>


  <td class="view-code">
     <a href="local_closure_goog_color_color.js.source.html#line147">code &raquo;</a>
  </td>
     </tr>


     <tr class="even entry public">
       <td class="access"></td>






  <td>
    <a name="goog.color.parse"></a>


     <div class="arg">
       <img align="left" src="static/images/blank.gif">

        <span class="entryNamespace">goog.color.</span><span class="entryName">parse<span class="args">(<span class="arg">str</span>)</span>
        </span>
        &#8658; <span class="type">{hex: string, type: string</span>
      </div>


     <div class="entryOverview">
       Parses a color out of a string.

     </div>


    <! -- Method details -->
    <div class="entryDetails">

      <div class="detailsSection">
        <b>Arguments: </b>






<table class="horiz-rule">
     
   <tr class="even">
     <td>
        <span class="entryName">str</span>
        : <span class="type"><a href="https://developer.mozilla.org/en/Core_JavaScript_1.5_Reference/Global_Objects/String">string</a></span>
        <div class="entryOverview">Color in some format.</div>
     </td>
   </tr>
  </table>
      </div>
   
      <div class="detailsSection">
        <b>Returns:</b>&nbsp;<span class="type">{hex: string, type: string</span>&nbsp;
            } 'hex' is a string containing a hex
    representation of the color, 'type' is a string containing the type
    of color format passed in ('hex', 'rgb', 'named').
      </div>
  
    </div>
   
  </td>


  <td class="view-code">
     <a href="local_closure_goog_color_color.js.source.html#line64">code &raquo;</a>
  </td>
     </tr>


     <tr class="odd entry public">
       <td class="access"></td>






  <td>
    <a name="goog.color.parseRgb"></a>


     <div class="arg">
       <img align="left" src="static/images/blank.gif">

        <span class="entryNamespace">goog.color.</span><span class="entryName">parseRgb<span class="args">(<span class="arg">str</span>)</span>
        </span>
        &#8658; <span>!</span><span class="type">goog.color.Rgb</span>
      </div>


     <div class="entryOverview">
       Parses red, green, blue components out of a valid rgb color string.
Throws Error if the color string is invalid.

     </div>


    <! -- Method details -->
    <div class="entryDetails">

      <div class="detailsSection">
        <b>Arguments: </b>






<table class="horiz-rule">
     
   <tr class="even">
     <td>
        <span class="entryName">str</span>
        : <span class="type"><a href="https://developer.mozilla.org/en/Core_JavaScript_1.5_Reference/Global_Objects/String">string</a></span>
        <div class="entryOverview">RGB representation of a color.
   .</div>
     </td>
   </tr>
  </table>
      </div>
   
      <div class="detailsSection">
        <b>Returns:</b>&nbsp;<span>!</span><span class="type">goog.color.Rgb</span>&nbsp;
            rgb representation of the color.
      </div>
  
    </div>
   
  </td>


  <td class="view-code">
     <a href="local_closure_goog_color_color.js.source.html#line113">code &raquo;</a>
  </td>
     </tr>


     <tr class="even entry public">
       <td class="access"></td>






  <td>
    <a name="goog.color.prependHashIfNecessaryHelper"></a>


     <div class="arg">
       <img align="left" src="static/images/blank.gif">

        <span class="entryNamespace">goog.color.</span><span class="entryName">prependHashIfNecessaryHelper<span class="args">(<span class="arg">str</span>)</span>
        </span>
        &#8658; <span class="type"><a href="https://developer.mozilla.org/en/Core_JavaScript_1.5_Reference/Global_Objects/String">string</a></span>
      </div>


     <div class="entryOverview">
       Takes a string a prepends a '#' sign if one doesn't exist.
Small helper method for use by goog.color and friends.

     </div>


    <! -- Method details -->
    <div class="entryDetails">

      <div class="detailsSection">
        <b>Arguments: </b>






<table class="horiz-rule">
     
   <tr class="even">
     <td>
        <span class="entryName">str</span>
        : <span class="type"><a href="https://developer.mozilla.org/en/Core_JavaScript_1.5_Reference/Global_Objects/String">string</a></span>
        <div class="entryOverview">String to check.</div>
     </td>
   </tr>
  </table>
      </div>
   
      <div class="detailsSection">
        <b>Returns:</b>&nbsp;<span class="type"><a href="https://developer.mozilla.org/en/Core_JavaScript_1.5_Reference/Global_Objects/String">string</a></span>&nbsp;
            The value passed in, prepended with a '#' if it didn't
    already have one.
      </div>
  
    </div>
   
  </td>


  <td class="view-code">
     <a href="local_closure_goog_color_color.js.source.html#line427">code &raquo;</a>
  </td>
     </tr>


     <tr class="odd entry public">
       <td class="access"></td>






  <td>
    <a name="goog.color.prependZeroIfNecessaryHelper"></a>


     <div class="arg">
       <img align="left" src="static/images/blank.gif">

        <span class="entryNamespace">goog.color.</span><span class="entryName">prependZeroIfNecessaryHelper<span class="args">(<span class="arg">hex</span>)</span>
        </span>
        &#8658; <span class="type"><a href="https://developer.mozilla.org/en/Core_JavaScript_1.5_Reference/Global_Objects/String">string</a></span>
      </div>


     <div class="entryOverview">
       Takes a hex value and prepends a zero if it's a single digit.
Small helper method for use by goog.color and friends.

     </div>


    <! -- Method details -->
    <div class="entryDetails">

      <div class="detailsSection">
        <b>Arguments: </b>






<table class="horiz-rule">
     
   <tr class="even">
     <td>
        <span class="entryName">hex</span>
        : <span class="type"><a href="https://developer.mozilla.org/en/Core_JavaScript_1.5_Reference/Global_Objects/String">string</a></span>
        <div class="entryOverview">Hex value to prepend if single digit.</div>
     </td>
   </tr>
  </table>
      </div>
   
      <div class="detailsSection">
        <b>Returns:</b>&nbsp;<span class="type"><a href="https://developer.mozilla.org/en/Core_JavaScript_1.5_Reference/Global_Objects/String">string</a></span>&nbsp;
            hex value prepended with zero if it was single digit,
    otherwise the same value that was passed in.
      </div>
  
    </div>
   
  </td>


  <td class="view-code">
     <a href="local_closure_goog_color_color.js.source.html#line415">code &raquo;</a>
  </td>
     </tr>


     <tr class="even entry public">
       <td class="access"></td>






  <td>
    <a name="goog.color.rgbArrayToHex"></a>


     <div class="arg">
       <img align="left" src="static/images/blank.gif">

        <span class="entryNamespace">goog.color.</span><span class="entryName">rgbArrayToHex<span class="args">(<span class="arg">rgb</span>)</span>
        </span>
        &#8658; <span class="type"><a href="https://developer.mozilla.org/en/Core_JavaScript_1.5_Reference/Global_Objects/String">string</a></span>
      </div>


     <div class="entryOverview">
       Converts a color from RGB to hex representation.

     </div>


    <! -- Method details -->
    <div class="entryDetails">

      <div class="detailsSection">
        <b>Arguments: </b>






<table class="horiz-rule">
     
   <tr class="even">
     <td>
        <span class="entryName">rgb</span>
        : <span class="type">goog.color.Rgb</span>
        <div class="entryOverview">rgb representation of the color.</div>
     </td>
   </tr>
  </table>
      </div>
   
      <div class="detailsSection">
        <b>Returns:</b>&nbsp;<span class="type"><a href="https://developer.mozilla.org/en/Core_JavaScript_1.5_Reference/Global_Objects/String">string</a></span>&nbsp;
            hex representation of the color.
      </div>
  
    </div>
   
  </td>


  <td class="view-code">
     <a href="local_closure_goog_color_color.js.source.html#line201">code &raquo;</a>
  </td>
     </tr>


     <tr class="odd entry public">
       <td class="access"></td>






  <td>
    <a name="goog.color.rgbArrayToHsl"></a>


     <div class="arg">
       <img align="left" src="static/images/blank.gif">

        <span class="entryNamespace">goog.color.</span><span class="entryName">rgbArrayToHsl<span class="args">(<span class="arg">rgb</span>)</span>
        </span>
        &#8658; <span>!</span><span class="type">goog.color.Hsl</span>
      </div>


     <div class="entryOverview">
       Converts a color from RGB color space to HSL color space.

     </div>


    <! -- Method details -->
    <div class="entryDetails">

      <div class="detailsSection">
        <b>Arguments: </b>






<table class="horiz-rule">
     
   <tr class="even">
     <td>
        <span class="entryName">rgb</span>
        : <span class="type">goog.color.Rgb</span>
        <div class="entryOverview">rgb representation of the color.</div>
     </td>
   </tr>
  </table>
      </div>
   
      <div class="detailsSection">
        <b>Returns:</b>&nbsp;<span>!</span><span class="type">goog.color.Hsl</span>&nbsp;
            hsl representation of the color.
      </div>
  
    </div>
   
  </td>


  <td class="view-code">
     <a href="local_closure_goog_color_color.js.source.html#line255">code &raquo;</a>
  </td>
     </tr>


     <tr class="even entry public">
       <td class="access"></td>






  <td>
    <a name="goog.color.rgbArrayToHsv"></a>


     <div class="arg">
       <img align="left" src="static/images/blank.gif">

        <span class="entryNamespace">goog.color.</span><span class="entryName">rgbArrayToHsv<span class="args">(<span class="arg">rgb</span>)</span>
        </span>
        &#8658; <span>!</span><span class="type">goog.color.Hsv</span>
      </div>


     <div class="entryOverview">
       Converts from an array of RGB values to an array of HSV values.

     </div>


    <! -- Method details -->
    <div class="entryDetails">

      <div class="detailsSection">
        <b>Arguments: </b>






<table class="horiz-rule">
     
   <tr class="even">
     <td>
        <span class="entryName">rgb</span>
        : <span class="type">goog.color.Rgb</span>
        <div class="entryOverview">rgb representation of the color.</div>
     </td>
   </tr>
  </table>
      </div>
   
      <div class="detailsSection">
        <b>Returns:</b>&nbsp;<span>!</span><span class="type">goog.color.Hsv</span>&nbsp;
            hsv representation of the color.
      </div>
  
    </div>
   
  </td>


  <td class="view-code">
     <a href="local_closure_goog_color_color.js.source.html#line551">code &raquo;</a>
  </td>
     </tr>


     <tr class="odd entry private">
       <td class="access"></td>






  <td>
    <a name="goog.color.rgbStyle_"></a>


     <div class="arg">
       <img align="left" src="static/images/blank.gif">

        <span class="entryNamespace">goog.color.</span><span class="entryName">rgbStyle_<span class="args">(<span class="arg">rgb</span>)</span>
        </span>
        &#8658; <span class="type"><a href="https://developer.mozilla.org/en/Core_JavaScript_1.5_Reference/Global_Objects/String">string</a></span>
      </div>


     <div class="entryOverview">
       Takes an array of [r, g, b] and converts it into a string appropriate for
CSS styles.

     </div>


    <! -- Method details -->
    <div class="entryDetails">

      <div class="detailsSection">
        <b>Arguments: </b>






<table class="horiz-rule">
     
   <tr class="even">
     <td>
        <span class="entryName">rgb</span>
        : <span class="type">goog.color.Rgb</span>
        <div class="entryOverview">rgb representation of the color.</div>
     </td>
   </tr>
  </table>
      </div>
   
      <div class="detailsSection">
        <b>Returns:</b>&nbsp;<span class="type"><a href="https://developer.mozilla.org/en/Core_JavaScript_1.5_Reference/Global_Objects/String">string</a></span>&nbsp;
            string of the form 'rgb(r,g,b)'.
      </div>
  
    </div>
   
  </td>


  <td class="view-code">
     <a href="local_closure_goog_color_color.js.source.html#line439">code &raquo;</a>
  </td>
     </tr>


     <tr class="even entry public">
       <td class="access"></td>






  <td>
    <a name="goog.color.rgbToHex"></a>


     <div class="arg">
       <img align="left" src="static/images/blank.gif">

        <span class="entryNamespace">goog.color.</span><span class="entryName">rgbToHex<span class="args">(<span class="arg">r</span>,&nbsp;<span class="arg">g</span>,&nbsp;<span class="arg">b</span>)</span>
        </span>
        &#8658; <span class="type"><a href="https://developer.mozilla.org/en/Core_JavaScript_1.5_Reference/Global_Objects/String">string</a></span>
      </div>


     <div class="entryOverview">
       Converts a color from RGB to hex representation.

     </div>


    <! -- Method details -->
    <div class="entryDetails">

      <div class="detailsSection">
        <b>Arguments: </b>






<table class="horiz-rule">
     
   <tr class="even">
     <td>
        <span class="entryName">r</span>
        : <span class="type"><a href="https://developer.mozilla.org/en/Core_JavaScript_1.5_Reference/Global_Objects/Number">number</a></span>
        <div class="entryOverview">Amount of red, int between 0 and 255.</div>
     </td>
   </tr>
     
   <tr class="odd">
     <td>
        <span class="entryName">g</span>
        : <span class="type"><a href="https://developer.mozilla.org/en/Core_JavaScript_1.5_Reference/Global_Objects/Number">number</a></span>
        <div class="entryOverview">Amount of green, int between 0 and 255.</div>
     </td>
   </tr>
     
   <tr class="even">
     <td>
        <span class="entryName">b</span>
        : <span class="type"><a href="https://developer.mozilla.org/en/Core_JavaScript_1.5_Reference/Global_Objects/Number">number</a></span>
        <div class="entryOverview">Amount of blue, int between 0 and 255.</div>
     </td>
   </tr>
  </table>
      </div>
   
      <div class="detailsSection">
        <b>Returns:</b>&nbsp;<span class="type"><a href="https://developer.mozilla.org/en/Core_JavaScript_1.5_Reference/Global_Objects/String">string</a></span>&nbsp;
            hex representation of the color.
      </div>
  
    </div>
   
  </td>


  <td class="view-code">
     <a href="local_closure_goog_color_color.js.source.html#line180">code &raquo;</a>
  </td>
     </tr>


     <tr class="odd entry public">
       <td class="access"></td>






  <td>
    <a name="goog.color.rgbToHsl"></a>


     <div class="arg">
       <img align="left" src="static/images/blank.gif">

        <span class="entryNamespace">goog.color.</span><span class="entryName">rgbToHsl<span class="args">(<span class="arg">r</span>,&nbsp;<span class="arg">g</span>,&nbsp;<span class="arg">b</span>)</span>
        </span>
        &#8658; <span>!</span><span class="type">goog.color.Hsl</span>
      </div>


     <div class="entryOverview">
       Converts a color from RGB color space to HSL color space.
Modified from <code> <a href="http://en.wikipedia.org/wiki/HLS_color_space">http://en.wikipedia.org/wiki/HLS_color_space</a></code>.

     </div>


    <! -- Method details -->
    <div class="entryDetails">

      <div class="detailsSection">
        <b>Arguments: </b>






<table class="horiz-rule">
     
   <tr class="even">
     <td>
        <span class="entryName">r</span>
        : <span class="type"><a href="https://developer.mozilla.org/en/Core_JavaScript_1.5_Reference/Global_Objects/Number">number</a></span>
        <div class="entryOverview">Value of red, in [0, 255].</div>
     </td>
   </tr>
     
   <tr class="odd">
     <td>
        <span class="entryName">g</span>
        : <span class="type"><a href="https://developer.mozilla.org/en/Core_JavaScript_1.5_Reference/Global_Objects/Number">number</a></span>
        <div class="entryOverview">Value of green, in [0, 255].</div>
     </td>
   </tr>
     
   <tr class="even">
     <td>
        <span class="entryName">b</span>
        : <span class="type"><a href="https://developer.mozilla.org/en/Core_JavaScript_1.5_Reference/Global_Objects/Number">number</a></span>
        <div class="entryOverview">Value of blue, in [0, 255].</div>
     </td>
   </tr>
  </table>
      </div>
   
      <div class="detailsSection">
        <b>Returns:</b>&nbsp;<span>!</span><span class="type">goog.color.Hsl</span>&nbsp;
            hsl representation of the color.
      </div>
  
    </div>
   
  </td>


  <td class="view-code">
     <a href="local_closure_goog_color_color.js.source.html#line214">code &raquo;</a>
  </td>
     </tr>


     <tr class="even entry public">
       <td class="access"></td>






  <td>
    <a name="goog.color.rgbToHsv"></a>


     <div class="arg">
       <img align="left" src="static/images/blank.gif">

        <span class="entryNamespace">goog.color.</span><span class="entryName">rgbToHsv<span class="args">(<span class="arg">red</span>,&nbsp;<span class="arg">green</span>,&nbsp;<span class="arg">blue</span>)</span>
        </span>
        &#8658; <span>!</span><span class="type">goog.color.Hsv</span>
      </div>


     <div class="entryOverview">
       Converts from RGB values to an array of HSV values.

     </div>


    <! -- Method details -->
    <div class="entryDetails">

      <div class="detailsSection">
        <b>Arguments: </b>






<table class="horiz-rule">
     
   <tr class="even">
     <td>
        <span class="entryName">red</span>
        : <span class="type"><a href="https://developer.mozilla.org/en/Core_JavaScript_1.5_Reference/Global_Objects/Number">number</a></span>
        <div class="entryOverview">Red value in [0, 255].</div>
     </td>
   </tr>
     
   <tr class="odd">
     <td>
        <span class="entryName">green</span>
        : <span class="type"><a href="https://developer.mozilla.org/en/Core_JavaScript_1.5_Reference/Global_Objects/Number">number</a></span>
        <div class="entryOverview">Green value in [0, 255].</div>
     </td>
   </tr>
     
   <tr class="even">
     <td>
        <span class="entryName">blue</span>
        : <span class="type"><a href="https://developer.mozilla.org/en/Core_JavaScript_1.5_Reference/Global_Objects/Number">number</a></span>
        <div class="entryOverview">Blue value in [0, 255].</div>
     </td>
   </tr>
  </table>
      </div>
   
      <div class="detailsSection">
        <b>Returns:</b>&nbsp;<span>!</span><span class="type">goog.color.Hsv</span>&nbsp;
            hsv representation of the color.
      </div>
  
    </div>
   
  </td>


  <td class="view-code">
     <a href="local_closure_goog_color_color.js.source.html#line512">code &raquo;</a>
  </td>
     </tr>


     <tr class="odd entry private">
       <td class="access"></td>






  <td>
    <a name="goog.color.yiqBrightnessDiff_"></a>


     <div class="arg">
       <img align="left" src="static/images/blank.gif">

        <span class="entryNamespace">goog.color.</span><span class="entryName">yiqBrightnessDiff_<span class="args">(<span class="arg">rgb1</span>,&nbsp;<span class="arg">rgb2</span>)</span>
        </span>
        &#8658; <span class="type"><a href="https://developer.mozilla.org/en/Core_JavaScript_1.5_Reference/Global_Objects/Number">number</a></span>
      </div>


     <div class="entryOverview">
       Calculate difference in brightness of two colors. Helper method for
goog.color.highContrast()

     </div>


    <! -- Method details -->
    <div class="entryDetails">

      <div class="detailsSection">
        <b>Arguments: </b>






<table class="horiz-rule">
     
   <tr class="even">
     <td>
        <span class="entryName">rgb1</span>
        : <span class="type">goog.color.Rgb</span>
        <div class="entryOverview">Color represented by a rgb array.</div>
     </td>
   </tr>
     
   <tr class="odd">
     <td>
        <span class="entryName">rgb2</span>
        : <span class="type">goog.color.Rgb</span>
        <div class="entryOverview">Color represented by a rgb array.</div>
     </td>
   </tr>
  </table>
      </div>
   
      <div class="detailsSection">
        <b>Returns:</b>&nbsp;<span class="type"><a href="https://developer.mozilla.org/en/Core_JavaScript_1.5_Reference/Global_Objects/Number">number</a></span>&nbsp;
            Brightness difference.
      </div>
  
    </div>
   
  </td>


  <td class="view-code">
     <a href="local_closure_goog_color_color.js.source.html#line759">code &raquo;</a>
  </td>
     </tr>


     <tr class="even entry private">
       <td class="access"></td>






  <td>
    <a name="goog.color.yiqBrightness_"></a>


     <div class="arg">
       <img align="left" src="static/images/blank.gif">

        <span class="entryNamespace">goog.color.</span><span class="entryName">yiqBrightness_<span class="args">(<span class="arg">rgb</span>)</span>
        </span>
        &#8658; <span class="type"><a href="https://developer.mozilla.org/en/Core_JavaScript_1.5_Reference/Global_Objects/Number">number</a></span>
      </div>


     <div class="entryOverview">
       Calculate brightness of a color according to YIQ formula (brightness is Y).
More info on YIQ here: <a href="http://en.wikipedia.org/wiki/YIQ">http://en.wikipedia.org/wiki/YIQ</a>. Helper method for
goog.color.highContrast()

     </div>


    <! -- Method details -->
    <div class="entryDetails">

      <div class="detailsSection">
        <b>Arguments: </b>






<table class="horiz-rule">
     
   <tr class="even">
     <td>
        <span class="entryName">rgb</span>
        : <span class="type">goog.color.Rgb</span>
        <div class="entryOverview">Color represented by a rgb array.</div>
     </td>
   </tr>
  </table>
      </div>
   
      <div class="detailsSection">
        <b>Returns:</b>&nbsp;<span class="type"><a href="https://developer.mozilla.org/en/Core_JavaScript_1.5_Reference/Global_Objects/Number">number</a></span>&nbsp;
            brightness (Y).
      </div>
  
    </div>
   
  </td>


  <td class="view-code">
     <a href="local_closure_goog_color_color.js.source.html#line746">code &raquo;</a>
  </td>
     </tr>


  </table>
</div>






      <!-- Column 1 end -->
    </div>

        <div class="col2">
          <!-- Column 2 start -->
          <div class="col2-c">
            <h2 id="ref-head">Directory color</h2>
            <div id="localView"></div>
          </div>

          <div class="col2-c">
            <h2 id="ref-head">File Reference</h2>
            <div id="sideFileIndex" rootPath="" current="/goog/color/color.js"></div>
          </div>
          <!-- Column 2 end -->
        </div>
</div>
</div>

</body>
</html>
